package com.gamesnet.ihm;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.gamesnet.api.Session;
import com.gamesnet.widget.ActionBar;

public class DashboardActivity extends Activity implements View.OnClickListener{
	
	private Button mur;
	private Button actualite;
	private Button amis;
	private Button evenements;
	private Button messagerie;
	private Button compte;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.dashboard);

		final ActionBar actionBarHaut = (ActionBar) findViewById(R.id.actionbarHaut);
		actionBarHaut.setTitre(PageTitle.DASHBOARD);
		
		mur = (Button) findViewById(R.id.buttonMur);
		actualite = (Button) findViewById(R.id.buttonActualite); 
		amis = (Button) findViewById(R.id.buttonAmis);
		evenements = (Button) findViewById(R.id.buttonEvenements);
		messagerie = (Button) findViewById(R.id.buttonMessagerie);
		compte = (Button) findViewById(R.id.buttonCompte);
		
		mur.setOnClickListener(this);
		actualite.setOnClickListener(this);
		amis.setOnClickListener(this);
		evenements.setOnClickListener(this);
		messagerie.setOnClickListener(this);
		compte.setOnClickListener(this);
	}

	public void onClick(View v) {
		
		if(v == mur){
			Intent intent = new Intent(this, WallActivity.class);
			intent.putExtra("userId", Session.getInstance().getUser().getId());
			startActivity(intent);
		}
		if(v == actualite){
			startActivity(new Intent(this, ActuActivity.class));
		}
		if(v == amis){
			startActivity(new Intent(this, FriendsActivity.class));
		}
		if(v == evenements){
			startActivity(new Intent(this, EventsActivity.class));
		}
		if(v == messagerie){
			startActivity(new Intent(this, MessageListActivity.class));
		}
		if(v == compte){
			Intent intent = new Intent(this, CompteActivity.class);
			intent.putExtra("userId", Session.getInstance().getUser().getId());
			startActivity(intent);
		}
		
	}
}
